<?php
chdir(__DIR__.'/..');
global $tf;

if (!empty($tf['html.footerscript'])) {
	echo '<script>'.$tf['html.footerscript'].'</script>';
}

if (file_exists("custom/footer.html")) {
	echo file_get_contents("custom/footer.html");
}
if (file_exists("custom/footer.php")) {
	echo include("custom/footer.php");
}
if (!empty($tf['auth.keepalive'])) {
	?>
	<script>
		keepalive_object=new Image();
		window.setInterval(function() {
			keepalive_object.src='./tfconfigure.php?noop=1&random='+Math.random();
		},4*60000); // keep session every 4 minutes
	</script>
	<?
}

if (!empty($tf['html.footer'])) {
	echo $tf['html.footer'];
}
?>
</body>
</html>